package com.quan.site.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.quan.commons.annotation.OperationLog;
import com.quan.commons.core.MyBaseController;
import com.quan.commons.vo.R;
import com.quan.site.commons.vo.SiteAboutVo;
import com.quan.site.entity.SiteAbout;
import com.quan.site.service.SiteAboutService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 官网-关于我们-了解华智，总裁致辞
 *
 * @author yhaoquan
 * @email yhaoquan@163.com
 * @date 2023-08-13 21:55:52
 */
@Slf4j
@Api(tags = "官网-关于我们-了解华智，总裁致辞")
@RestController
@RequestMapping("/api/siteabout")
public class ApiSiteAboutController extends MyBaseController {

    @Autowired
    private SiteAboutService service;


    /**
     * 多条件查询信息详情
     *
     * @param vo
     * @return
     */
    @OperationLog(module = "官网-关于我们-了解华智，总裁致辞", title = "查询详情")
    @GetMapping("/info")
    public R info(SiteAboutVo vo) {
        QueryWrapper<SiteAbout> queryWrapper = new QueryWrapper<SiteAbout>(vo);
        SiteAbout siteAbout = this.service.getOne(queryWrapper);
        return R.ok().data(siteAbout);
    }

    /**
     * 根据ID查询信息详情
     *
     * @param {id}
     * @return
     */
    @OperationLog(module = "官网-关于我们-了解华智，总裁致辞", title = "查询详情")
    @GetMapping("/info/{id}")
    public R info(@PathVariable("id") Long id) {
        SiteAbout siteAbout = this.service.getById(id);
        return R.ok().data(siteAbout);
    }

}
